package com.project.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @ProjectName:
 * @Package:
 * @ClassName:
 * @Author: ZhaoLongShi
 * @CreateDate:
 */
@Configuration
@Component
public class AliyunConfig {
    @Resource
    private OSSConfigProperties configProperties;

    @Bean
    public OSS oss() {
        return new OSSClientBuilder().build(configProperties.getEndpoint(), configProperties.getAccessKeyId(), configProperties.getAccessKeySecret());
    }
}
